<div class="content">
    <div class="layui-card ">
        <div class="search_box">
            <form id="search-form" class="layui-form layui-clear" role="form" data-toggle="validator" method="GET" action="{:url('manage/payslip_feedback')}">
                <div class="search_item">
                    <a class="item{:$status==0?' active':''}" href="{:url('manage/payslip_feedback')}">全部</a>
                    <a class="item{:$status==2?' active':''}" href="{:url('manage/payslip_feedback', ['status' => 2])}">已处理</a>
                    <a class="item{:$status==1?' active':''}" href="{:url('manage/payslip_feedback', ['status' => 1])}">未处理</a>
                </div>
                <div class="search_input">
                    <input type="hidden" name="page" value="{$lists.current_page}">
                    <input type="text" name="keywords" value="{$keywords|htmlentities}" placeholder="请输入员工姓名、手机号搜索" class="layui-input">
                    <button type="submit" class="search_icon iconfont icon-sousuo"></button>
                </div>
            </form>
        </div>
        <div class="layui-card-body">
            <div class="fk_content">
                <table class="layui-table" lay-skin="line" lay-even="">
                    <thead>
                    <tr>
                        <th width="70">姓名</th>
                        <th width="80">部门</th>
                        <th width="100">职位</th>
                        <th width="90">账号</th>
                        <th width="70">月份</th>
                        <th width="160">工资条名称</th>
                        <th>反馈内容</th>
                        <th width="70">状态</th>
                        <th width="50">操作</th>
                    </tr>
                    </thead>
                    <tbody>
                    {if $lists.data}
                    {foreach $lists.data as $item}
                    <tr>
                        <td>{$item.nickname|default='-'}</td>
                        <td>{$item.department_name|default='-'}</td>
                        <td>{$item.position|default='-'}</td>
                        <td>{$item.username|default='-'}</td>
                        <td>{$item.month|default='-'}</td>
                        <td>{$item.month|strtotime|date='Y年m月',###}工资</td>
                        <td>{$item.content|default='-'}</td>
                        <td>{if $item.status == 2}已处理{else}<span class="color_EF4033">未处理</span>{/if}</td>
                        <td><a class="cl_but view_btn_{$item.id}" data-id="{$item.id}">{if $item.status == 2}查看{else}处理{/if}</a></td>
                    </tr>
                    {/foreach}
                    {/if}
                    </tbody>
                </table>
            </div>
            <div id="laypage" data-total="{$lists.total}" data-per_page="{$lists.per_page}" data-current_page="{$lists.current_page}"></div>
        </div>
    </div>
</div>

<div class="pop cl_pop">
    <div class="pop_content">
        <form id="post-form" class="layui-form layui-clear" role="form" data-toggle="validator" method="POST" action="{:url('manage/payslip_feedback_save')}"></form>
    </div>
</div>

<script type="text/html" id="pop_tpl">
    <div class="layui-card-header">反馈处理</div>
    <div class="cl_content">
        <div class="pipei_item2">
            <div class="head_img"><img src="<%=data['avatar']%>" alt=""></div>
            <h3><%=data['nickname']%></h3>
            <p><%=data['department_name']%></p>
        </div>
        <% for(i = 0; i < data['content'].length; i ++) { %>
        <% if (data['content'][i]['answer'] == '') { %>
        <div class="cl_item">
            <div class="layui-elem-quote">员工反馈</div>
            <div class="fk_text"><%=data['content'][i]['question']%></div>
            <div class="layui-elem-quote">处理结果</div>
            <div class="fk_text">
                <textarea placeholder="请输入处理结果…" name="content[<%=i%>]" data-rule="required" data-msg-required="请输入处理结果"></textarea>
            </div>
        </div>
        <% } else { %>
        <div class="cl_item2">
            <div class="item">
                <h3><%=data['content'][i]['question']%></h3>
                <p><%=data['content'][i]['answer']%></p>
                <p class="time"><%=data['content'][i]['answer_time']%></p>
                <i class="iconfont icon-shanchu" data-id="<%=data['id']%>" data-key="<%=i%>"></i>
            </div>
        </div>
        <% } %>
        <% } %>
    </div>
    <div class="but">
        <% if (data['status'] == 1) { %>
        <input type="hidden" name="id" value="<%=data['id']%>">
        <button type="button" class="layui-btn layui-btn-primary">取消</button>
        <button type="submit" class="layui-btn layui-btn-determine">提交处理结果</button>
        <% } else { %>
        <button type="button" class="layui-btn layui-btn-primary">关闭</button>
        <% } %>
    </div>
</script>
